package com.yindian.cos.easy.security.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * easy security配置项
 *
 * @author zhangchuanhao
 * @create 2018/11/18
 */
@Data
@Component
@ConfigurationProperties(prefix = "easy.security.authorization")
public class EasySecurityProperties {

    /**
     * 是否开启easy security
     */
    private Boolean enable = false;

    /**
     * 第三方登录获取到用户信息之后的默认处理器
     */
    private Boolean defaultPostProcessorEnable = false;

    /**
     * 是否开启默认mysql策略存储第三方用户
     */
    private Boolean mysqlUserInfoStoreEnable = false;

    /**
     * 表名前缀，表名默认为social_user
     */
    private String tablePrefix;

    /**
     * 第三方用户第一次登录时应该引导用户跳转的注册地址
     */
    private String registerUrl;

    /**
     * 是否开启默认redis策略存储token
     */
    private Boolean redisTokenStoreEnable = false;

    /**
     * 是否启用jwt生成策略
     */
    private Boolean jwtTokenFactoryEnable = false;

    /**
     * oauth2访问配置
     */
    private Map<String, ClientProperties> clients;

    /**
     * token配置
     */
    private TokenProperties token = new TokenProperties();

    /**
     * 表单登录验证码配置
     */
    private FormLoginProperties form = new FormLoginProperties();

    /**
     * 短信验证码登录配置
     */
    private SmsCodeLoginProperties smsCode = new SmsCodeLoginProperties();

    /**
     * qq登录配置
     */
    private QqProperties qq = new QqProperties();

    /**
     * 新浪微博登录配置
     */
    private WeiBoProperties weibo = new WeiBoProperties();

    /**
     * 微信登录配置
     */
    private WeiXinProperties weixin = new WeiXinProperties();

    /**
     * basic auth配置
     */
    private BasicAuthProperties basicAuth = new BasicAuthProperties();

    /**
     * token验证
     */
    private TokenVerifyProperties tokenVerify = new TokenVerifyProperties();

    /**
     * 退出配置项
     */
    private LogoutProperties logout = new LogoutProperties();
}
